﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using eBay.Service.Core.Soap;

namespace eBayBus.Block
{
    public class BuyRequirementBlock
    {
        public static Dictionary<string, string> _BuyRequirementBlocks = new Dictionary<string, string>();

                public BuyRequirementBlock()
        {
            Init();
        }

        private static void Init()
        {
            if (_BuyRequirementBlocks.Keys.Count > 0) return;


            _BuyRequirementBlocks.Add("US_BLOCK_ALL", "US_BLOCK_ALL");
        }

        public static Dictionary<string, string> GetAll()
        {
            Init();
            return _BuyRequirementBlocks;
        }

        public static void SetBlock(string key, ItemType i1)
        {

            switch (key)
            {
                case "US_BLOCK_ALL":

                    #region US_BLOCK_ALL

                    i1.BuyerRequirementDetails = new BuyerRequirementDetailsType();
                    //i1.BuyerRequirementDetails.LinkedPayPalAccount = true;
                    //i1.BuyerRequirementDetails.LinkedPayPalAccountSpecified = true;

                    i1.BuyerRequirementDetails.MaximumUnpaidItemStrikesInfo = new MaximumUnpaidItemStrikesInfoType();
                    i1.BuyerRequirementDetails.MaximumUnpaidItemStrikesInfo.Count = 4;
                    i1.BuyerRequirementDetails.MaximumUnpaidItemStrikesInfo.CountSpecified = true;
                    i1.BuyerRequirementDetails.MaximumUnpaidItemStrikesInfo.Period = PeriodCodeType.Days_30;
                    i1.BuyerRequirementDetails.MaximumUnpaidItemStrikesInfo.PeriodSpecified = true;

                    i1.BuyerRequirementDetails.ShipToRegistrationCountry = true;
                    i1.BuyerRequirementDetails.ShipToRegistrationCountrySpecified = true;

                    i1.BuyerRequirementDetails.MaximumBuyerPolicyViolations = new MaximumBuyerPolicyViolationsType();
                    i1.BuyerRequirementDetails.MaximumBuyerPolicyViolations.Count = 4;
                    i1.BuyerRequirementDetails.MaximumBuyerPolicyViolations.CountSpecified = true;
                    i1.BuyerRequirementDetails.MaximumBuyerPolicyViolations.Period = PeriodCodeType.Days_30;
                    i1.BuyerRequirementDetails.MaximumBuyerPolicyViolations.PeriodSpecified = true;

                    i1.BuyerRequirementDetails.MinimumFeedbackScore = -1;
                    i1.BuyerRequirementDetails.MinimumFeedbackScoreSpecified = true;

                    i1.BuyerRequirementDetails.MaximumItemRequirements = new MaximumItemRequirementsType();
                    i1.BuyerRequirementDetails.MaximumItemRequirements.MaximumItemCount = 10;
                    i1.BuyerRequirementDetails.MaximumItemRequirements.MaximumItemCountSpecified = true;

                    //i1.BuyerRequirementDetails.MaximumItemRequirements.MinimumFeedbackScore = 1;
                    //i1.BuyerRequirementDetails.MaximumItemRequirements.MinimumFeedbackScoreSpecified = true;


                    #endregion

                    break;

                default:
                    break;
            }

        }
    }
}
